package com.study.product.controller;

import com.study.product.bean.Product;
import com.study.product.service.IProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: WPX
 * @Create: 2025/07/31
 **/
@RestController
public class ProductController {
    @Autowired
    private IProductService productService;

    @GetMapping("/product/{id}")
    public Product getProduct(@PathVariable("id") Long id) {
        System.out.println("hello");
        return productService.getProductById(id);
    }
}
